// _GraphDialog.cpp : implementation file
#include "stdafx.h"
#include "FlexGraph.h"
#include "_GraphDialog.h"
#include "afxdialogex.h"

// _GraphDialog dialog
IMPLEMENT_DYNAMIC(_GraphDialog, CDialogEx)

// Constructor & Destructor
_GraphDialog::_GraphDialog(CWnd* pParent, CRect Rect, _FGHandle DialogHandle)
	: CDialogEx(_GraphDialog::IDD, pParent)
{
	m_ControlRect = Rect;
	m_pParentWnd = pParent;
	setDialogHandle(DialogHandle);
}

_GraphDialog::~_GraphDialog()
{
}

// Data
void _GraphDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(_GraphDialog, CDialogEx)
	ON_WM_CREATE()
	ON_WM_MOUSEMOVE()
	ON_WM_MOUSEWHEEL()
END_MESSAGE_MAP()

// _GraphDialog message handlers
int _GraphDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	ScreenToClient(m_ControlRect);
	m_GraphControl.Create(  NULL,   
							NULL,   
							WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE,
							m_ControlRect,
							this,  
							0);    
	return EXIT_SUCCESS;
}

_GraphControl* _GraphDialog::getGraphControl()
{
	return &m_GraphControl;
}

void _GraphDialog::OnMouseMove(UINT nFlags, CPoint point)
{
    CDialogEx::OnMouseMove(nFlags, point);
}

BOOL _GraphDialog::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
	return CDialogEx::OnMouseWheel(nFlags, zDelta, pt);
}
